// ============================================================================
//
// Copyright (C) 2006-2007 Dengues
//
// Google Group: http://groups.google.com/group/dengues
// QQ Group: 24885404
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ============================================================================
package org.dengues.designer.core.data.models;

import org.dengues.core.metadata.MetadataTable;
import org.dengues.core.process.EConnectionType;
import org.dengues.core.process.ICompBlock;
import org.dengues.core.process.ICompConnection;
import org.dengues.core.process.ICompNode;

/**
 * Qiang.Zhang.Adolf@gmail.com class global comment. Detailled comment <br/>
 * 
 * $Id: Dengues.epf 1 2006-09-29 17:06:40Z qiang.zhang $
 * 
 */
public class AbstractCompConnection implements ICompConnection {

    private MetadataTable metadata;

    private String name;

    private ICompNode source;

    private ICompNode target;

    public AbstractCompConnection() {
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#disconnect()
     */
    public void disconnect() {

    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getMetadata()
     */
    public MetadataTable getMetadata() {
        return metadata;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getName()
     */
    public String getName() {
        return name;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getSource()
     */
    public ICompNode getSource() {
        return source;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getTarget()
     */
    public ICompNode getTarget() {
        return target;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#reconnect()
     */
    public void reconnect() {

    }

    /**
     * Sets the metadata.
     * 
     * @param metadata the metadata to set
     */
    public void setMetadata(MetadataTable metadata) {
        this.metadata = metadata;
    }

    /**
     * Sets the name.
     * 
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Sets the source.
     * 
     * @param source the source to set
     */
    public void setSource(ICompNode source) {
        this.source = source;
    }

    /**
     * Sets the target.
     * 
     * @param target the target to set
     */
    public void setTarget(ICompNode target) {
        this.target = target;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getParent()
     */
    public ICompBlock getParent() {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#setParent(org.dengues.core.process.ICompBlock)
     */
    public void setParent(ICompBlock block) {

    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dengues.core.process.ICompConnection#getType()
     */
    public EConnectionType getType() {
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Name:" + name + "  Table:" + getMetadata();
    }

}
